﻿using CleanArchitecture.Core.SharedKernel;
using System;

namespace CleanArchitecture.Infrastructure.Entities.Customers
{
    public class Customer : BaseEntity
    {
        public Customer()
        {
            this.PasswordFormat = EntityEnumConfig.PasswordFormat.Clear;
        }
        public string CustomerName { get; set; }
        public string CustomerLoginname { get; set; }
        public string Mobile { get; set; }
        public string Email { get; set; }
        public string Password { get; set; }
        public int PasswordFormatId { get; set; }
        public EntityEnumConfig.PasswordStrongLevel PasswordStrongLevel { get; set; }
        public string PasswordSalt { get; set; }
        /// <summary>
        /// 用户尝试登录次数
        /// </summary>
        public int FailedLoginAttempts { get; set; }
        public EntityEnumConfig.Sex Sex { get; set; }
        public string Birthday { get; set; }
        public string LastLoginIp { get; set; }
        public DateTime LastLoginTimeUtc { get; set; }
        public string LevelCode { get; set; }
        /// <summary>
        /// 用户是否处于锁定状态，如登录三次密码校验错误将会处于锁定状态 1-未锁定 0-锁定
        /// </summary>
        public EntityEnumConfig.LockState IsActive { get; set; }

        /// <summary>
        /// 用户是否已注销 1-注销 0-正常使用
        /// </summary>
        public EntityEnumConfig.DeleteState IsDeleted { get; set; }
        public DateTime CreatedOnTimeUtc { get; set; }
        public EntityEnumConfig.PasswordFormat PasswordFormat
        {
            get => (EntityEnumConfig.PasswordFormat)PasswordFormatId;
            set => PasswordFormatId = (int)value;
        }


    }
}
